package spring.j2024_11_19_2.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import spring.j2024_11_19_2.model.UserModel;

import java.util.ArrayList;
import java.util.List;

@Repository
public class UserDao {
     private List<UserModel> list = new ArrayList<>();

     public UserDao(){
       mockList();
     }

    private void mockList() {
        for (int i = 0; i < 10; i++) {
            UserModel userModel = new UserModel();
            userModel.setId(i);
            userModel.setName("name " + i);
            list.add(userModel);
        }
     }

    public List<UserModel> getList() {
        return list;
    }


}
